Skip to content

Fix failing errata ui tests - #20840

Merged
aidenfine merged 5 commits into
SatelliteQE:masterfrom
aidenfine:SAT-39214-fix-ui-errata-tests
Feb 26, 2026
Merged

Fix failing errata ui tests#20840
aidenfine merged 5 commits into
SatelliteQE:masterfrom
aidenfine:SAT-39214-fix-ui-errata-tests

Conversation

@aidenfine

@aidenfine aidenfine commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

Problem Statement

Some Errata UI tests failing due to content hosts page removal

Solution

Remove/fix parts of test that use content hosts page

Related Issues

https://issues.redhat.com/browse/SAT-42273

PRT test Cases example

trigger: test-robottelo
pytest: tests/foreman/ui/test_errata.py -k "positive_check_errata or positive_content_host_previous_env or positive_errata_search_type or positive_filtered_errata_status_installable_param"

PRT usage reference link: https://github.com/SatelliteQE/robottelo/wiki/Robottelo-Pull-Request-Testing-(PRT)-Process#usage-examples

Summary by Sourcery

Adjust errata UI tests to avoid removed content hosts page and ensure errata applicability is reflected after package installation tasks complete.

Bug Fixes:

  • Remove reliance on the deprecated content hosts page in errata UI tests that caused failures.
  • Ensure errata-related tests wait for and verify bulk applicability generation tasks after yum installs to avoid timing-related failures.

Enhancements:

  • Tag affected errata UI tests with the no_containers marker and standardize timestamp formatting using the shared time format constant.

@aidenfine
aidenfine requested a review from a team as a code owner February 23, 2026 16:01
@sourcery-ai

sourcery-ai Bot commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

This PR updates errata UI tests to remove dependencies on the deprecated content hosts page and to make errata applicability checks more robust and deterministic, mainly by removing an obsolete assertion block, adding container-skipping markers, normalizing timestamp handling, and explicitly waiting for applicability tasks after yum installations.

File-Level Changes

Change Details Files
Remove obsolete verification using the deprecated content hosts page in the previous environment test.
  • Deleted the session-based navigation and search_errata call against the content hosts page for a VM in a previous lifecycle environment.
  • Removed the assertion that verified the expected errata ID via the content host errata search in the previous environment.
tests/foreman/ui/test_errata.py
Strengthen errata search and status tests by synchronizing on applicability tasks and using consistent timestamp formatting.
  • In the host content errata search-by-type test, added dependency on module_target_sat, captured hostname and a formatted install timestamp, and waited for Bulk generate applicability tasks after yum install, asserting at least one task is found.
  • In the errata counts-by-type test, changed the install_timestamp from a datetime object to a formatted string using TIMESTAMP_FMT to align with task search expectations.
  • In the filtered errata status installable parameter test, added a formatted install timestamp, waited for Bulk generate applicability tasks after yum install on the client, and asserted that at least one such task is found.
tests/foreman/ui/test_errata.py
Add markers to skip certain errata tests in containerized environments.
  • Applied the @pytest.mark.no_containers marker to the errata search-by-type host test.
  • Applied the @pytest.mark.no_containers marker to the errata counts-by-type host details test and the upgrade errata status installable test.
tests/foreman/ui/test_errata.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The new applicability wait logic (computing install_timestamp, running yum install, and then polling module_target_sat.wait_for_tasks) is duplicated across multiple tests; consider extracting this into a small helper to keep the tests DRY and easier to maintain.
  • Now that install_timestamp is formatted via strftime(TIMESTAMP_FMT) in some tests but not others, it might be worth standardizing the timestamp handling (possibly by a shared helper) to avoid subtle differences in how started_at filters are constructed.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new applicability wait logic (computing `install_timestamp`, running `yum install`, and then polling `module_target_sat.wait_for_tasks`) is duplicated across multiple tests; consider extracting this into a small helper to keep the tests DRY and easier to maintain.
- Now that `install_timestamp` is formatted via `strftime(TIMESTAMP_FMT)` in some tests but not others, it might be worth standardizing the timestamp handling (possibly by a shared helper) to avoid subtle differences in how `started_at` filters are constructed.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@aidenfine

Copy link
Copy Markdown
Contributor Author
trigger: test-robottelo
pytest: tests/foreman/ui/test_errata.py

@aidenfine aidenfine added the No-CherryPick PR doesnt need CherryPick to previous branches label Feb 23, 2026
@Satellite-QE

Copy link
Copy Markdown
Collaborator

PRT Result

Build Number: 14415
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_errata.py --external-logging
Test Result : =========== 7 failed, 25 passed, 865 warnings in 9382.00s (2:36:22) ============

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Feb 23, 2026
@aidenfine

Copy link
Copy Markdown
Contributor Author
trigger: test-robottelo
pytest: tests/foreman/ui/test_errata.py -k "positive_check_errata or positive_content_host_previous_env or positive_errata_search_type or positive_filtered_errata_status_installable_param"

@vsedmik vsedmik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One Q

Comment thread tests/foreman/ui/test_errata.py Outdated
assert host_tab_erratum[0]['Errata'] == CUSTOM_REPO_ERRATA_ID


@pytest.mark.no_containers

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonder if we can keep the container hosts (they are deployed much faster and should be sufficient for these cases) and get these tests passing.

Does the consequential wait_for_tasks fail, or what it the reason behind this change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was unable to get wait_for_tasks to pass without that pytest mark. Do you know the reason for this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it could be related to the package profile upload again. Will need to check..

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vsedmik what if we use container_host as it is and just update search query to include orgnization id in it?
ex-

search_query=(
            f'Bulk generate applicability for host {hostname}'
            f' and started_at >= "{install_timestamp}"'
            f' and organzation_id = {module_sca_manifest_org.id}'
        )

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO not necessary @vijaysawant. PRT passed as is.

@aidenfine

Copy link
Copy Markdown
Contributor Author
trigger: test-robottelo
pytest: tests/foreman/ui/test_errata.py -k "positive_check_errata or positive_content_host_previous_env or positive_errata_search_type or positive_filtered_errata_status_installable_param"

@aidenfine

Copy link
Copy Markdown
Contributor Author
trigger: test-robottelo
pytest: tests/foreman/ui/test_errata.py -k "positive_check_errata or positive_content_host_previous_env or positive_errata_search_type or positive_filtered_errata_status_installable_param"

@vijaysawant vijaysawant left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aidenfine can you check with the suggested changes?
use content_host and update search query to include host id.

Comment thread tests/foreman/ui/test_errata.py
Comment thread tests/foreman/ui/test_errata.py Outdated
assert host_tab_erratum[0]['Errata'] == CUSTOM_REPO_ERRATA_ID


@pytest.mark.no_containers

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vsedmik what if we use container_host as it is and just update search query to include orgnization id in it?
ex-

search_query=(
            f'Bulk generate applicability for host {hostname}'
            f' and started_at >= "{install_timestamp}"'
            f' and organzation_id = {module_sca_manifest_org.id}'
        )

@aidenfine

Copy link
Copy Markdown
Contributor Author
trigger: test-robottelo
pytest: tests/foreman/ui/test_errata.py -k "positive_check_errata or positive_content_host_previous_env or positive_errata_search_type or positive_filtered_errata_status_installable_param"

@aidenfine aidenfine added PRT-Passed Indicates that latest PRT run is passed for the PR CherryPick PR needs CherryPick to previous branches AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing 6.19.z and removed PRT-Failed Indicates that latest PRT run is failed for the PR No-CherryPick PR doesnt need CherryPick to previous branches labels Feb 25, 2026

@vsedmik vsedmik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@vijaysawant vijaysawant left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Ack.

@aidenfine
aidenfine merged commit 6e909f9 into SatelliteQE:master Feb 26, 2026
16 checks passed
github-actions Bot pushed a commit that referenced this pull request Feb 26, 2026
* fix failing errata tests

* add subscription-manager repo command to fix failing test

* remove no containers mark

* remove no_containers from test_positive_errata_search_type

(cherry picked from commit 6e909f9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.19.z AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing CherryPick PR needs CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed for the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants